﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BIExtAuth.DBUtility;

namespace BIExtAuth.DAL
{
    public class SSASMGDAL
    {
        private SSASDBHelper asDBHelper = null;
        public SSASMGDAL()
        {
            this.asDBHelper = new SSASDBHelper();
        }

        public SSASMGDAL(string connString)
        {
            this.asDBHelper = new SSASDBHelper(connString);
        }

        /// <summary>
        /// 获取所有的AS数据库
        /// </summary>
        /// <returns>AS数据库列表</returns>
        public Microsoft.AnalysisServices.DatabaseCollection GetAllDatabase()
        {
            return this.asDBHelper.GetAllDatabase();
        }

        /// <summary>
        /// 获取AS数据库所有的Cube
        /// </summary>
        /// <param name="dbname">AS数据名称</param>
        /// <returns>所有Cube列表</returns>
        public Microsoft.AnalysisServices.CubeCollection GetAllCubeBydbname(string dbname)
        {
            return this.asDBHelper.GetAllCubeBydbname(dbname);
        }

        /// <summary>
        /// 获取AS数据库所有的角色
        /// </summary>
        /// <param name="dbname">AS数据名称</param>
        /// <returns>所有角色列表</returns>
        public Microsoft.AnalysisServices.RoleCollection GetAllRoleBydbname(string dbname)
        {
            return this.asDBHelper.GetAllRoleBydbname(dbname);
        }
    }
}
